package com.itemDevelop.items.itemTest.grid.entity;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.itemDevelop.items.itemTest.common.entity.IdEntity;

/**
 * grid实体对象
 */
@Entity
@Table(name = "ui_grid")
public class Grid extends IdEntity
{
	private static final long serialVersionUID = -8667752576882655785L;
	private String name;// varchar(64) 数据grid的名称
	private String title;// varchar(128) grid的标题
	private String dataSource;// varchar(64) ajax取数方式对应的url地址
	private String method;// 数据的查询方法
	private String extraData;// ajax取数时附加到请求的额外参数,AJAX的结构
	private Integer width;// varchar(32) 宽度:是fit表示自适应父容器
	private Integer height;// varchar(32) 高度:是fit表示自适应父容器
	private Integer pageSize;// int(11) 页的记录大小
	private Integer singleSelect;// varchar(8) 设成true时将不会出现checkbox列，设成false则将自动出现checkbox列
	private Integer showIndex;// varchar(8) 是否在最左边显示序号列
	private String remark; // 备注说明

	private List<List<GridColumn>> colModel;

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getDataSource()
	{
		return dataSource;
	}

	public void setDataSource(String dataSource)
	{
		this.dataSource = dataSource;
	}

	public String getMethod()
	{
		return method;
	}

	public void setMethod(String method)
	{
		this.method = method;
	}

	public String getExtraData()
	{
		return extraData;
	}

	public void setExtraData(String extraData)
	{
		this.extraData = extraData;
	}

	public Integer getWidth()
	{
		return width;
	}

	public void setWidth(Integer width)
	{
		this.width = width;
	}

	public Integer getHeight()
	{
		return height;
	}

	public void setHeight(Integer height)
	{
		this.height = height;
	}

	public Integer getPageSize()
	{
		return pageSize;
	}

	public void setPageSize(Integer pageSize)
	{
		this.pageSize = pageSize;
	}

	public Integer getSingleSelect()
	{
		return singleSelect;
	}

	public void setSingleSelect(Integer singleSelect)
	{
		this.singleSelect = singleSelect;
	}

	public Integer getShowIndex()
	{
		return showIndex;
	}

	public void setShowIndex(Integer showIndex)
	{
		this.showIndex = showIndex;
	}

	/**
	 * 此属性是无需持久化到数据库，加@Transient注解即可
	 * 
	 * @author：lifuyu
	 * @return
	 */
	@Transient
	public List<List<GridColumn>> getColModel()
	{
		return colModel;
	}

	public void setColModel(List<List<GridColumn>> colModel)
	{
		this.colModel = colModel;
	}

	public String getRemark()
	{
		return remark;
	}

	public void setRemark(String remark)
	{
		this.remark = remark;
	}

	@Transient
	public int getLimit()
	{
		return this.pageSize;
	}
}
